
// callback作为最后一个参数！
export function promiseCallback(func: Function): Function {
	return (...arg): Promise<void> => new Promise((resolve, reject) => {
			func(...arg, (rt) => resolve(rt));
		});
}

// callback作为第一个参数！
export function promiseCallback0(func:Function): Function {
	return (...arg): Promise<void> => new Promise((resolve, reject) => {
			func(() => resolve(), ...arg);
		});
}
